import request from '@/utils/request'

//获取待我审批任务列表
export function getTodoTaskListApi(data){
	return request({
		url: '/bpm/task/todo-page',
		method: 'GET',
		params: data
	})
}

// 获取经我审批任务列表
export function getDoneTaskListApi(data){
	return request({
		url:'/bpm/task/done-page',
		method: 'GET',
		params: data
	})
}

// 获取我申请的审批任务列表
export function getMyTaskListApi(data){
	return request({
		url: '/bpm/process-instance/my-page',
		method: 'GET',
		params: data
	})
}

//获取抄送列表
export function getCopyListApi(data){
	return request({
		url: '/bpm/process-instance/copy/page',
		method: 'GET',
		params: data
	})
}

//获取审批详情
export function getDetailsApi(id){
	return request({
		url: `/bpm/process-instance/get?id=${id}`,
		method: 'GET'
	})
}

// 通过审批
export function approvalPassApi(data){
	return request({
		url: '/bpm/task/approve',
		method: 'PUT',
		data: data
	})
}

// 不通过审批
export function approvalRejectApi(data){
	return request({
		url: '/bpm/task/reject',
		method: 'PUT',
		data: data
	})
}

// 退回审批
export function approvalReturnApi(data){
	return request({
		url: '/bpm/task/return',
		method: 'PUT',
		data: data
	})
}

//获得指定流程实例任务列表
export function getProcessInstanceIdApi(processInstanceId){
	return request({
		url: `/bpm/task/list-by-process-instance-id?processInstanceId=${processInstanceId}`,
		method: 'GET'
	})
}

// 获得项目交付申请
export function getDeliverDetailApi(id){
	return request({
		url: `/crm/project/deliver?id=${id}`,
		method: 'GET'
	})
}
// 获得项目暂停申请
export function getProjectPauseApi(id){
	return request({
		url: `/crm/project/pause?id=${id}`,
		method: 'GET'
	})
}
// 获得项目作废申请
export function getProjectRepealApi(id){
	return request({
		url: `/crm/project/invalidate?id=${id}`,
		method: 'GET'
	})
}
// 获得项目归档申请
export function getProjectDocumentApi(id){
	return request({
		url: `/crm/project/file?id=${id}`,
		method: 'GET'
	})
}
// 获得合同作废申请
export function getContractCancelApi(id){
	return request({
		url: `/crm/contract/invalidate/apply?id=${id}`,
		method: 'GET'
	})
}
// 获得回款作废申请
export function getPaymentCancelApi(id){
	return request({
		url: `/crm/receivable/invalidate?id=${id}`,
		method: 'GET'
	})
}
